package com.csii.oauth.exception.impl;
import com.csii.core.api.Result;
import com.csii.oauth.exception.ExceptionOutput;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;
import org.springframework.http.ResponseEntity;

/**
 * @Description TODO
 * @Date 2020/10/16 13:45
 * @Created by Ian
 * @Contact: 19107614@qq.com
 */
@Order(2)
@ConditionalOnMissingBean(ExceptionOutput.class)
@Configuration
public class AuthExceptionOutput implements ExceptionOutput {

    @Override
    public ResponseEntity<String> outputAuthException(Exception e) {
        return ResponseEntity.ok(Result.noauth(null).toString());
    }
}
